<!DOCTYPE html>
<html>
<head>
    <title>(原创)谷歌地图地理解析和反解析geocode.geocoder详解  &#8211;  半叶寒羽</title>
    <!--[if lt IE 9]>
    <script src="http://www.yanue.net/wp-content/themes/wp-senth/js/html5shiv.js" type="text/javascript"></script>
    <![endif]-->
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://www.yanue.net/wp-content/themes/wp-senth/style.css" media="all">
    <link rel="stylesheet" type="text/css" href="http://www.yanue.net/wp-content/themes/wp-senth/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" type="text/css" href="http://www.yanue.net/wp-content/themes/wp-senth/css/yanue.css" media="all">
    <link rel='stylesheet' id='crayon-theme-familiar-css'  href='http://www.yanue.net/wp-content/plugins/crayon-syntax-highlighter/themes/familiar/familiar.css?ver=2.4.1' type='text/css' media='all' />
    <link rel='stylesheet' id='crayon-font-tahoma-css'  href='http://www.yanue.net/wp-content/plugins/crayon-syntax-highlighter/fonts/tahoma.css?ver=2.4.1' type='text/css' media='all' />
    <script type="text/javascript">
        var duoshuoQuery = {"short_name":"yanue","sso":{"login":"http:\/\/www.yanue.net\/wp-login.php?action=duoshuo_login","logout":"http:\/\/www.yanue.net\/wp-login.php?action=logout&_wpnonce=4d2016eb53"},"theme":"default","stylePatch":"wordpress\/wp-senth"};
        duoshuoQuery.sso.login += '&redirect_to=' + encodeURIComponent(window.location.href);
        duoshuoQuery.sso.logout += '&redirect_to=' + encodeURIComponent(window.location.href);
    </script>
    <script type="text/javascript" src="http://static.duoshuo.com/embed.js" charset="UTF-8" async="async"></script>
    <link rel='prev' title='(原创)经纬度查询,经纬度(批量)查找地名,地名(批量)查询经纬度,google map地理解析geocode.geocoder实例' href='http://www.yanue.net/archives/207.html' />
    <link rel='next' title='JQuery获取和设置Select选项方法' href='http://www.yanue.net/archives/311.html' />
    <link rel='canonical' href='http://www.yanue.net/archives/217.html' />
    <link rel='shortlink' href='http://www.yanue.net/?p=217' />
</head>
<body>
<header class="header">
    <div>
        <nav class="top-nav"><ul id="top-nav" class="nav"><li id="menu-item-646" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-646"><a title="首页" href="http://www.yanue.net/">HOME</a></li>
                <li id="menu-item-387" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-387"><a href="http://www.yanue.net/archives/category/original">原创文章</a></li>
                <li id="menu-item-388" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-388"><a href="http://www.yanue.net/archives/category/p-h-p">PHP</a></li>
                <li id="menu-item-395" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-395"><a href="http://www.yanue.net/archives/category/google-map">Google Map</a></li>
                <li id="menu-item-524" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-524"><a href="http://www.yanue.net/archives/category/linux">Linux</a></li>
                <li id="menu-item-645" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-645"><a href="http://www.yanue.net/archives/category/sql">Sql</a></li>
                <li id="menu-item-389" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-389"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88">前端综合</a></li>
                <li id="menu-item-656" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-656"><a href="http://www.yanue.net/original">原创作品</a></li>
                <li id="menu-item-647" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-647"><a title="半叶寒羽 &#8211; 原创地图作品" href="http://map.yanue.net/">地图作品</a></li>
                <li id="menu-item-644" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-644"><a href="http://www.yanue.net/about">关于我</a></li>
            </ul></nav>        <div class="clear"></div>
    </div>
</header><aside class="panel">
    <header class="logo">
        <p>
            <a href="http://www.yanue.net/" class="logo-link" title="半叶寒羽">
                <img src="http://www.yanue.net/wp-content/themes/wp-senth/images/logo.png" alt="半叶寒羽">
            </a>
        </p>
    </header>
    <p class="panel-welcome">
        yanue.net &#8211; 关注WEB前端 探索HTML5 深入php    </p>
    <p style="color:#888;margin:20px 0;text-align:center;">
        欢迎光临小站
    </p>
    <h2 class="panel-title">资源列表</h2>
    <ul class="panel-menus">
        <li><a href="http://www.yanue.net/" class="current"><i class="icon icon-angle-right" title="半叶寒羽 - 原创地图 - 经纬度转换工具"></i>个人博客</a></li>
        <li><a href="http://map.yanue.net/" target="_blank"><i class="icon icon-angle-right" title="半叶寒羽 - 原创地图 - 经纬度转换工具"></i>地图作品 - 原创</a></li>
        <li><a href="http://stephp.yanue.net/" target="_blank" title="Stephp - A Simple Easy Tiny MVC PHP Framework"><i class="icon icon-angle-right"></i>Stephp - My PHP Framework</a></li>
        <li><a href="http://tool.yanue.net/" title="css/js/html格式化美化压缩"><i class="icon icon-angle-right"></i>前端工具箱</a></li>
        <!--    <li><a href="javascript:;" title="敬请期待"><i class="icon icon-angle-right"></i>在线手册[全]</a></li>
            <li><a href="javascript:;" title="敬请期待"><i class="icon icon-angle-right"></i>查询工具[全]</a></li>-->
    </ul>
    <p style="color:#666;margin:20px 0;text-align:center;">
        联系我
    </p>
    <ul class="panel-contact">
        <li>QQ : 642399406</li>
        <li>Email : yanue@outlook.com</li>
    </ul>
    <!--    <p>-->
    <!--        <a href="--><!--">意见反馈</a>-->
    <!--    </p>-->
    <footer class="panel-footer">
        <p class="theme-info">Private Theme wp-senth by yanue.</p>
        <p class="copyright">2013 &copy; yanue.net - 半叶寒羽</p>
    </footer>
</aside><div class="main clearfix">
<div class="content">
<section class="region">
<div class="region-content" >
<nav class="show-path">
    <a href="http://www.yanue.net/"><i class="icon-home"></i> 首页</a>
    &raquo; <a href="http://www.yanue.net/archives/category/google-map" title="查看Google Map中的全部文章" rel="category tag">Google Map</a> | <a href="http://www.yanue.net/archives/category/original" title="查看原创文章中的全部文章" rel="category tag">原创文章</a> &raquo;        <a href="http://www.yanue.net/archives/217.html" title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解" rel="bookmark">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a>


</nav>
<article class="post single" id="post-217" >
<header class="post-head">
    <div class="post-type">
        <a href="">
            <i class="icon icon-code" title="作者"></i>
        </a>
    </div>
    <h2 class="post-title">
        <a href="http://www.yanue.net/archives/217.html" title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解" rel="bookmark">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a>
    </h2>
    <p class="post-info">
            <span>
                <i class="icon icon-user" title="作者"></i>
                yanue            </span>
            <span>
                <i class="icon icon-calendar" title="日期"></i>
                2012/06/09            </span>
            <span>
                 <a class="link-comments" href="http://www.yanue.net/archives/217.html#comments">
                     <i class="icon icon-comments" title="评论"></i>
                     <span class="ds-thread-count" data-thread-key="217" data-replace="1">10条评论</span>                 </a>
            </span>
            <span>
                <i class="icon icon-bar-chart" title="点击"></i> 10,019            </span>
    </p>
</header>
<section class="post-content">
<div class="announcement_post"><p>地址解析就是将地址(如：贵州省贵阳市)转换为地理坐标(如经度：106.71，纬度：26.57)的过程。</p>
<p>地理反解析和上面的过程相反是将地理坐标(如纬度：26.57，经度：106.71)转换为地址(中国贵州省贵阳市南明区翠微巷7号 邮政编码: 550002)的过程。<br />
    受当地法律限制及各方面原因，国内很多地图并不包含地理解析和反解析功能（地理解析和反解析功能功能不够强悍），Google永远是最棒的。废话不多说<br />
    要使用到Google map 地理解析和反解析功能，我们需要了解google.maps.Geocoder类，谷歌地图给我们提供了强大的api，下面我们来实现<br />
    <strong>1.初始化地图</strong>(最基本的，不解释)</p>
<div id="crayon-528e2a7feb6fe305425847" class="crayon-syntax crayon-theme-familiar crayon-font-tahoma crayon-os-pc print-yes" data-settings=" minimize scroll-mouseover disable-anim wrap" style=" margin-top: 12px; margin-bottom: 12px; float: none; clear: both; font-size: 12px !important; line-height: 15px !important;">

    <div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
        <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-plain-button" title="纯文本显示代码"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="在新窗口中显示代码"><div class="crayon-button-icon"></div></div></div></div>
    <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
    <div class="crayon-plain-wrap"><textarea  class="crayon-plain print-no" data-settings="" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;">
            //初始化地图
            var map = new google.maps.Map(document.getElementById("map_canvas"),{
            center : new google.maps.LatLng(26.57, 106.72),
            zoom : 8,
            mapTypeId : google.maps.MapTypeId.ROADMAP
            });</textarea></div>
    <div class="crayon-main" style="">
        <table class="crayon-table">
            <tr class="crayon-row">
                <td class="crayon-nums " data-settings="show">
                    <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-528e2a7feb6fe305425847-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb6fe305425847-2">2</div><div class="crayon-num" data-line="crayon-528e2a7feb6fe305425847-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb6fe305425847-4">4</div><div class="crayon-num" data-line="crayon-528e2a7feb6fe305425847-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb6fe305425847-6">6</div></div>
                </td>
                <td class="crayon-code"><div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-line" id="crayon-528e2a7feb6fe305425847-1"><span class="crayon-c">//初始化地图</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb6fe305425847-2"><span class="crayon-t">var</span><span class="crayon-h"> </span><span class="crayon-i">map</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-i">google</span><span class="crayon-sy">.</span><span class="crayon-i">maps</span><span class="crayon-sy">.</span><span class="crayon-e">Map</span><span class="crayon-sy">(</span><span class="crayon-i">document</span><span class="crayon-sy">.</span><span class="crayon-e">getElementById</span><span class="crayon-sy">(</span><span class="crayon-s">"map_canvas"</span><span class="crayon-sy">)</span><span class="crayon-sy">,</span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-528e2a7feb6fe305425847-3"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-i">center</span><span class="crayon-h"> </span><span class="crayon-o">:</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-i">google</span><span class="crayon-sy">.</span><span class="crayon-i">maps</span><span class="crayon-sy">.</span><span class="crayon-e">LatLng</span><span class="crayon-sy">(</span><span class="crayon-cn">26.57</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-cn">106.72</span><span class="crayon-sy">)</span><span class="crayon-sy">,</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb6fe305425847-4"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-i">zoom</span><span class="crayon-h"> </span><span class="crayon-o">:</span><span class="crayon-h"> </span><span class="crayon-cn">8</span><span class="crayon-sy">,</span></div><div class="crayon-line" id="crayon-528e2a7feb6fe305425847-5"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-i">mapTypeId</span><span class="crayon-h"> </span><span class="crayon-o">:</span><span class="crayon-h"> </span><span class="crayon-i">google</span><span class="crayon-sy">.</span><span class="crayon-i">maps</span><span class="crayon-sy">.</span><span class="crayon-i">MapTypeId</span><span class="crayon-sy">.</span><span class="crayon-cn">ROADMAP</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb6fe305425847-6"><span class="crayon-sy">}</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div></div></td>
            </tr>
        </table>
    </div>
</div><p><strong>2.实例化谷歌Geocoder服务</strong></p>
<div id="crayon-528e2a7feb72e434506410" class="crayon-syntax crayon-theme-familiar crayon-font-tahoma crayon-os-pc print-yes" data-settings=" minimize scroll-mouseover disable-anim wrap" style=" margin-top: 12px; margin-bottom: 12px; float: none; clear: both; font-size: 12px !important; line-height: 15px !important;">

    <div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
        <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-plain-button" title="纯文本显示代码"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="在新窗口中显示代码"><div class="crayon-button-icon"></div></div></div></div>
    <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
    <div class="crayon-plain-wrap"><textarea  class="crayon-plain print-no" data-settings="" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;">
            //实例化Geocoder服务
            var geocoder = new google.maps.Geocoder();</textarea></div>
    <div class="crayon-main" style="">
        <table class="crayon-table">
            <tr class="crayon-row">
                <td class="crayon-nums " data-settings="show">
                    <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-528e2a7feb72e434506410-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb72e434506410-2">2</div></div>
                </td>
                <td class="crayon-code"><div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-line" id="crayon-528e2a7feb72e434506410-1"><span class="crayon-c">//实例化Geocoder服务</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb72e434506410-2"><span class="crayon-t">var</span><span class="crayon-h"> </span><span class="crayon-i">geocoder</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-i">google</span><span class="crayon-sy">.</span><span class="crayon-i">maps</span><span class="crayon-sy">.</span><span class="crayon-e">Geocoder</span><span class="crayon-sy">(</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div></div></td>
            </tr>
        </table>
    </div>
</div><p>这样我们就可以进行地理解析和反解析了，使用代码：</p>
<div id="crayon-528e2a7feb73d375203543" class="crayon-syntax crayon-theme-familiar crayon-font-tahoma crayon-os-pc print-yes" data-settings=" minimize scroll-mouseover disable-anim wrap" style=" margin-top: 12px; margin-bottom: 12px; float: none; clear: both; font-size: 12px !important; line-height: 15px !important;">

    <div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
        <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-plain-button" title="纯文本显示代码"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="在新窗口中显示代码"><div class="crayon-button-icon"></div></div></div></div>
    <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
    <div class="crayon-plain-wrap"><textarea  class="crayon-plain print-no" data-settings="" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;">
            geocoder.geocode(request:GeocoderRequest, callback:function(Array.&lt;GeocoderResult&gt;, GeocoderStatus))</textarea></div>
    <div class="crayon-main" style="">
        <table class="crayon-table">
            <tr class="crayon-row">
                <td class="crayon-nums " data-settings="show">
                    <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-528e2a7feb73d375203543-1">1</div></div>
                </td>
                <td class="crayon-code"><div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-line" id="crayon-528e2a7feb73d375203543-1"><span class="crayon-i">geocoder</span><span class="crayon-sy">.</span><span class="crayon-e">geocode</span><span class="crayon-sy">(</span><span class="crayon-i">request</span><span class="crayon-o">:</span><span class="crayon-i">GeocoderRequest</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-i">callback</span><span class="crayon-o">:</span><span class="crayon-t">function</span><span class="crayon-sy">(</span><span class="crayon-t">Array</span><span class="crayon-sy">.</span><span class="crayon-o">&lt;</span><span class="crayon-i">GeocoderResult</span><span class="crayon-o">&gt;</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-i">GeocoderStatus</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span></div></div></td>
            </tr>
        </table>
    </div>
</div><p><strong>i.数据请求：</strong></p>
<p><strong></strong>其中需要进行请求的数据GeocoderRequest可为4种属性：</p>
<table>
    <thead>
    <tr>
        <th>属性</th>
        <th>类型</th>
        <th>描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><code>address</code></td>
        <td><code>string</code></td>
        <td>需要解析的地名. 可选.</td>
    </tr>
    <tr>
        <td><code>bounds</code></td>
        <td><code>LatLngBounds</code></td>
        <td>经纬度搜索范围. 可选.（我没有具体试用过）</td>
    </tr>
    <tr>
        <td><code>location</code></td>
        <td><code>LatLng（注意类型）</code></td>
        <td>需要解析的经纬度. 可选.</td>
    </tr>
    <tr>
        <td><code>region</code></td>
        <td><code>string</code></td>
        <td>国家代码. 可选.（我没有具体试用过）</td>
    </tr>
    </tbody>
</table>
<p>对于解析我们使用address，反解析使用location(注意传入的类型)，请求的话，至少选择一种。</p>
<p><strong>ii:结果处理：</strong></p>
<p>而对于回掉函数（即解析后返回的处理函数）包含两个内容，GeocoderResult（解析结果，数组类型）和GeocoderStatus（解析状态）<br />
    1.<span style="color: #ff0000;">解析状态</span>是使用Geocoder()进行解析后返回的状态，包含5种：</p>
<p>ERROR（谷歌地图服务可能出错）<br />
    INVALID_REQUEST（GeocoderRequest无效，即输入的请求是错误的，可能是没有选择，或者属性写错）<br />
    OK（解析完成，并有相应数据）<br />
    OVER_QUERY_LIMIT（响应超时）<br />
    REQUEST_DENIED（网页被禁止geocoder解析）<br />
    UNKNOWN_ERROR（未知错误）<br />
    ZERO_RESULTS（零结果）</p>
<p>我们能用的就是<span style="color: #ff0000;">状态为OK</span>的情况<br />
    2.<span style="color: #ff0000;">解析结果</span></p>
<table>
    <thead>
    <tr>
        <th>属性</th>
        <th>类型</th>
        <th>描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><code>address_components</code></td>
        <td><code>Array.&lt;<a href="https://developers.google.com/maps/documentation/javascript/reference#GeocoderAddressComponent">GeocoderAddressComponent</a>&gt;</code></td>
        <td><code>GeocoderAddressComponent</code>s数组</td>
    </tr>
    <tr>
        <td><code>formatted_address</code></td>
        <td><code>string</code></td>
        <td>格式化后的最佳匹配地址（地名可小到街道）</td>
    </tr>
    <tr>
        <td><code>geometry</code></td>
        <td><code><a href="https://developers.google.com/maps/documentation/javascript/reference#GeocoderGeometry">GeocoderGeometry</a></code></td>
        <td><code>GeocoderGeometry</code> 对象</td>
    </tr>
    <tr>
        <td><code>types</code></td>
        <td><code>Array.&lt;string&gt;</code></td>
        <td>一个表示返回的地理编码元素的类型的字符串数组</td>
    </tr>
    </tbody>
</table>
<p>其中每一次解析成功后都会有上面的信息，我们最需要的就两样formatted_address和geometry。而address_components是一个地名数组，包含long_name（比如只返回省市名称），short_name和types，可以自己去试一下。</p>
<p>a. 格式化后的地名formatted_address，只需直接调用即可</p>
<p>b.geometry返回一个<code>GeocoderGeometry</code> 对象，其中又包含有4个属性</p>
<table>
    <thead>
    <tr>
        <th>Properties</th>
        <th>Type</th>
        <th>Description</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><code>bounds</code></td>
        <td><code><a href="https://developers.google.com/maps/documentation/javascript/reference#LatLngBounds">LatLngBounds</a></code></td>
        <td>解析出来的精确的界限</td>
    </tr>
    <tr>
        <td><code>location</code></td>
        <td><code><a href="https://developers.google.com/maps/documentation/javascript/reference#LatLng">LatLng</a></code></td>
        <td>纬度/经度坐标</td>
    </tr>
    <tr>
        <td><code>location_type</code></td>
        <td><code><a href="https://developers.google.com/maps/documentation/javascript/reference#GeocoderLocationType">GeocoderLocationType</a></code></td>
        <td>返回的<code>location类型</code></td>
    </tr>
    <tr>
        <td><code>viewport</code></td>
        <td><code><a href="https://developers.google.com/maps/documentation/javascript/reference#LatLngBounds">LatLngBounds</a></code></td>
        <td>解析结果的视图范围</td>
    </tr>
    </tbody>
</table>
<p>至此，所有关于地理解析和反解析就差不多说明完了，具体api参见<a href="https://developers.google.com/maps/documentation/javascript/reference#Geocoder">https://developers.google.com/maps/documentation/javascript/reference#Geocoder</a>。</p>
<p>感觉说的好晕！基于此我做了一个关于批量解析和反解析的应用，详见：<span style="color: #ff0000;"><a href="http://map.yanue.net/geo.html"><span style="color: #ff0000;">http://map.yanue.net/geo.html</span></a></span>，<a href="http://map.yanue.net/geo.html">http://map.yanue.net/toLatLng</a> .使用详解：<span style="color: #ff0000;"><span style="color: #ff0000;"><a href="http://www.yanue.net/archives/207.html">http://www.yanue.net/archives/207.html</a> ，</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #ff0000;">下面我们来实例一下</span></span></p>
<p><span style="color: #ff0000;">实例代码：</span>（你有必要复制到本地试一下）</p>
<div id="crayon-528e2a7feb752161715216" class="crayon-syntax crayon-theme-familiar crayon-font-tahoma crayon-os-pc print-yes" data-settings=" minimize scroll-mouseover disable-anim wrap" style=" margin-top: 12px; margin-bottom: 12px; float: none; clear: both; font-size: 12px !important; line-height: 15px !important;">

    <div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
        <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-mixed-highlight" title="含多种语言"></span><div class="crayon-button crayon-plain-button" title="纯文本显示代码"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="在新窗口中显示代码"><div class="crayon-button-icon"></div></div></div></div>
    <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
    <div class="crayon-plain-wrap"><textarea  class="crayon-plain print-no" data-settings="" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;">
            &lt;!DOCTYPE html&gt;
            &lt;html&gt;
            &lt;head&gt;
            &lt;meta charset="UTF-8"&gt;
            &lt;script src="http://maps.google.com/maps/api/js?sensor=false&amp;libraries=places" type="text/javascript"&gt;&lt;/script&gt;
            &lt;title&gt;谷歌地图地理解析和反解析geocode.geocoder详解&lt;/title&gt;
            &lt;meta name="author" content="yanue" /&gt;
            &lt;meta name="copyright" content="powered by yanue" /&gt;
            &lt;link rel="site" href="http://map.yanue.net/" /&gt;
            &lt;script type="text/javascript"&gt;
            window.onload = function() {
            //初始化地图
            var map = new google.maps.Map(document.getElementById("map_canvas"),{
            center : new google.maps.LatLng(26.57, 106.72),
            zoom : 8,
            mapTypeId : google.maps.MapTypeId.ROADMAP
            });
            //实例化Geocoder服务
            var geocoder = new google.maps.Geocoder();

            //1.地理解析过程
            //请求数据GeocoderRequest为address，值为'贵阳'
            geocoder.geocode({address:'贵阳'},function geoResults(results, status){
            //这里是回掉函数(即结果处理函数)
            //状态为Ok说明有结果
            if (status == google.maps.GeocoderStatus.OK) {
            //一般情况下会有多个结果
            //第一个结果为最佳匹配的结果（匹配地名最全的结果），这里只去第一个，其他的可以根据需要自己循环出来
            //格式化过后的地址
            alert('地理解析结果：'+results[0].formatted_address);
            //geometry是一个包含bounds（界限），location（纬度/经度坐标）,location_type和viewport（视图范围）
            //获取解析后的经纬度
            alert('地理解析结果：'+results[0].geometry.location);
            }else{
            alert("：error " + status);
            }
            });

            //2.地理反解析过程
            //请求数据GeocoderRequest为location，值类型为LatLng因此我们要实例化经纬度
            geocoder.geocode({location:new google.maps.LatLng(26.57, 106.72)},function geoResults(results, status){
            //这里处理结果和上面一模一样
            if (status == google.maps.GeocoderStatus.OK) {
            alert('地理反解析结果：'+results[0].formatted_address);
            alert('地理反解析结果：'+results[0].geometry.location);
            }else{
            alert("：error " + status);
            }
            });
            }
            &lt;/script&gt;
            &lt;/head&gt;
            &lt;body&gt;
            &lt;div id="map_canvas" style='width: 300px; height: 200px;'&gt;&lt;/div&gt;
            &lt;/body&gt;
            &lt;/html&gt;</textarea></div>
    <div class="crayon-main" style="">
        <table class="crayon-table">
            <tr class="crayon-row">
                <td class="crayon-nums " data-settings="show">
                    <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-2">2</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-4">4</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-6">6</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-7">7</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-8">8</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-9">9</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-10">10</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-11">11</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-12">12</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-13">13</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-14">14</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-15">15</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-16">16</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-17">17</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-18">18</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-19">19</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-20">20</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-21">21</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-22">22</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-23">23</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-24">24</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-25">25</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-26">26</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-27">27</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-28">28</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-29">29</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-30">30</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-31">31</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-32">32</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-33">33</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-34">34</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-35">35</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-36">36</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-37">37</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-38">38</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-39">39</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-40">40</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-41">41</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-42">42</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-43">43</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-44">44</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-45">45</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-46">46</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-47">47</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-48">48</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-49">49</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-50">50</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-51">51</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-52">52</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-53">53</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-54">54</div><div class="crayon-num" data-line="crayon-528e2a7feb752161715216-55">55</div><div class="crayon-num crayon-striped-num" data-line="crayon-528e2a7feb752161715216-56">56</div></div>
                </td>
                <td class="crayon-code"><div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important;"><div class="crayon-line" id="crayon-528e2a7feb752161715216-1"><span class="crayon-o">&lt;</span><span class="crayon-o">!</span><span class="crayon-e">DOCTYPE </span><span class="crayon-i">html</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-2"><span class="crayon-o">&lt;</span><span class="crayon-i">html</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-3"><span class="crayon-o">&lt;</span><span class="crayon-i">head</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-4"><span class="crayon-o">&lt;</span><span class="crayon-e">meta </span><span class="crayon-i">charset</span><span class="crayon-o">=</span><span class="crayon-s">"UTF-8"</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-5"><span class="crayon-ta">&lt;script </span><span class="crayon-e ">src</span><span class="crayon-o">=</span><span class="crayon-s">"http://maps.google.com/maps/api/js?sensor=false&amp;libraries=places"</span><span class="crayon-h"> </span><span class="crayon-e ">type</span><span class="crayon-o">=</span><span class="crayon-s">"text/javascript"</span><span class="crayon-o">&gt;</span><span class="crayon-ta">&lt;/script&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-6"><span class="crayon-o">&lt;</span><span class="crayon-i">title</span><span class="crayon-o">&gt;</span>谷歌地图地理解析和反解析<span class="crayon-i">geocode</span><span class="crayon-sy">.</span><span class="crayon-i">geocoder</span>详解<span class="crayon-o">&lt;</span><span class="crayon-o">/</span><span class="crayon-i">title</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-7"><span class="crayon-o">&lt;</span><span class="crayon-e">meta </span><span class="crayon-i">name</span><span class="crayon-o">=</span><span class="crayon-s">"author"</span><span class="crayon-h"> </span><span class="crayon-i">content</span><span class="crayon-o">=</span><span class="crayon-s">"yanue"</span><span class="crayon-h"> </span><span class="crayon-o">/</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-8"><span class="crayon-o">&lt;</span><span class="crayon-e">meta </span><span class="crayon-i">name</span><span class="crayon-o">=</span><span class="crayon-s">"copyright"</span><span class="crayon-h"> </span><span class="crayon-i">content</span><span class="crayon-o">=</span><span class="crayon-s">"powered by yanue"</span><span class="crayon-h"> </span><span class="crayon-o">/</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-9"><span class="crayon-o">&lt;</span><span class="crayon-e">link </span><span class="crayon-i">rel</span><span class="crayon-o">=</span><span class="crayon-s">"site"</span><span class="crayon-h"> </span><span class="crayon-i">href</span><span class="crayon-o">=</span><span class="crayon-s">"http://map.yanue.net/"</span><span class="crayon-h"> </span><span class="crayon-o">/</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-10"><span class="crayon-ta">&lt;script </span><span class="crayon-e ">type</span><span class="crayon-o">=</span><span class="crayon-s">"text/javascript"</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-11"><span class="crayon-v">window</span><span class="crayon-sy">.</span><span class="crayon-v">onload</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-t">function</span><span class="crayon-sy">(</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-12"><span class="crayon-c">//初始化地图</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-13"><span class="crayon-t">var</span><span class="crayon-h"> </span><span class="crayon-v">map</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-e">Map</span><span class="crayon-sy">(</span><span class="crayon-v">document</span><span class="crayon-sy">.</span><span class="crayon-e">getElementById</span><span class="crayon-sy">(</span><span class="crayon-s">"map_canvas"</span><span class="crayon-sy">)</span><span class="crayon-sy">,</span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-14"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-v">center :</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-e">LatLng</span><span class="crayon-sy">(</span><span class="crayon-cn">26.57</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-cn">106.72</span><span class="crayon-sy">)</span><span class="crayon-sy">,</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-15"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-v">zoom :</span><span class="crayon-h"> </span><span class="crayon-cn">8</span><span class="crayon-sy">,</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-16"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-v">mapTypeId :</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-v">MapTypeId</span><span class="crayon-sy">.</span><span class="crayon-i">ROADMAP</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-17"><span class="crayon-sy">}</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-18"><span class="crayon-c">//实例化Geocoder服务</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-19"><span class="crayon-t">var</span><span class="crayon-h"> </span><span class="crayon-v">geocoder</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-e">Geocoder</span><span class="crayon-sy">(</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-20">&nbsp;</div><div class="crayon-line" id="crayon-528e2a7feb752161715216-21"><span class="crayon-c">//1.地理解析过程</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-22"><span class="crayon-c">//请求数据GeocoderRequest为address，值为'贵阳'</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-23"><span class="crayon-v">geocoder</span><span class="crayon-sy">.</span><span class="crayon-e">geocode</span><span class="crayon-sy">(</span><span class="crayon-sy">{</span><span class="crayon-v">address:</span><span class="crayon-s">'贵阳'</span><span class="crayon-sy">}</span><span class="crayon-sy">,</span><span class="crayon-t">function</span><span class="crayon-h"> </span><span class="crayon-e">geoResults</span><span class="crayon-sy">(</span><span class="crayon-i">results</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-r">status</span><span class="crayon-sy">)</span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-24"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-c">//这里是回掉函数(即结果处理函数)</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-25"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-c">//状态为Ok说明有结果</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-26"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-st">if</span><span class="crayon-h"> </span><span class="crayon-sy">(</span><span class="crayon-r">status</span><span class="crayon-h"> </span><span class="crayon-o">==</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-v">GeocoderStatus</span><span class="crayon-sy">.</span><span class="crayon-i">OK</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-27"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-c">//一般情况下会有多个结果</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-28"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-c">//第一个结果为最佳匹配的结果（匹配地名最全的结果），这里只去第一个，其他的可以根据需要自己循环出来</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-29"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-c">//格式化过后的地址</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-30"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">'地理解析结果：'</span><span class="crayon-o">+</span><span class="crayon-v">results</span><span class="crayon-sy">[</span><span class="crayon-cn">0</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-i">formatted_address</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-31"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-c">//geometry是一个包含bounds（界限），location（纬度/经度坐标）,location_type和viewport（视图范围）</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-32"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-c">//获取解析后的经纬度&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-33"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">'地理解析结果：'</span><span class="crayon-o">+</span><span class="crayon-v">results</span><span class="crayon-sy">[</span><span class="crayon-cn">0</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-v">geometry</span><span class="crayon-sy">.</span><span class="crayon-i">location</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-34"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-sy">}</span><span class="crayon-st">else</span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-35"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">"：error "</span><span class="crayon-h"> </span><span class="crayon-o">+</span><span class="crayon-h"> </span><span class="crayon-r">status</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-36"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-sy">}</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-37"><span class="crayon-sy">}</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-38">&nbsp;</div><div class="crayon-line" id="crayon-528e2a7feb752161715216-39"><span class="crayon-c">//2.地理反解析过程</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-40"><span class="crayon-c">//请求数据GeocoderRequest为location，值类型为LatLng因此我们要实例化经纬度</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-41"><span class="crayon-v">geocoder</span><span class="crayon-sy">.</span><span class="crayon-e">geocode</span><span class="crayon-sy">(</span><span class="crayon-sy">{</span><span class="crayon-v">location:</span><span class="crayon-e">new </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-e">LatLng</span><span class="crayon-sy">(</span><span class="crayon-cn">26.57</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-cn">106.72</span><span class="crayon-sy">)</span><span class="crayon-sy">}</span><span class="crayon-sy">,</span><span class="crayon-t">function</span><span class="crayon-h"> </span><span class="crayon-e">geoResults</span><span class="crayon-sy">(</span><span class="crayon-i">results</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-r">status</span><span class="crayon-sy">)</span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-42"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-c">//这里处理结果和上面一模一样</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-43"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-st">if</span><span class="crayon-h"> </span><span class="crayon-sy">(</span><span class="crayon-r">status</span><span class="crayon-h"> </span><span class="crayon-o">==</span><span class="crayon-h"> </span><span class="crayon-v">google</span><span class="crayon-sy">.</span><span class="crayon-v">maps</span><span class="crayon-sy">.</span><span class="crayon-v">GeocoderStatus</span><span class="crayon-sy">.</span><span class="crayon-i">OK</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-44"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">'地理反解析结果：'</span><span class="crayon-o">+</span><span class="crayon-v">results</span><span class="crayon-sy">[</span><span class="crayon-cn">0</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-i">formatted_address</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-45"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">'地理反解析结果：'</span><span class="crayon-o">+</span><span class="crayon-v">results</span><span class="crayon-sy">[</span><span class="crayon-cn">0</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-v">geometry</span><span class="crayon-sy">.</span><span class="crayon-i">location</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-46"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-sy">}</span><span class="crayon-st">else</span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-47"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-r">alert</span><span class="crayon-sy">(</span><span class="crayon-s">"：error "</span><span class="crayon-h"> </span><span class="crayon-o">+</span><span class="crayon-h"> </span><span class="crayon-r">status</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-48"><span class="crayon-h">&nbsp;&nbsp;</span><span class="crayon-sy">}</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-49"><span class="crayon-sy">}</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-50"><span class="crayon-sy">}</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-51"><span class="crayon-ta">&lt;/script&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-52"><span class="crayon-o">&lt;</span><span class="crayon-o">/</span><span class="crayon-i">head</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-53"><span class="crayon-o">&lt;</span><span class="crayon-i">body</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-54"><span class="crayon-h">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-o">&lt;</span><span class="crayon-e">div </span><span class="crayon-i">id</span><span class="crayon-o">=</span><span class="crayon-s">"map_canvas"</span><span class="crayon-h"> </span><span class="crayon-i">style</span><span class="crayon-o">=</span><span class="crayon-s">'width: 300px; height: 200px;'</span><span class="crayon-o">&gt;</span><span class="crayon-o">&lt;</span><span class="crayon-o">/</span><span class="crayon-i">div</span><span class="crayon-o">&gt;</span></div><div class="crayon-line" id="crayon-528e2a7feb752161715216-55"><span class="crayon-o">&lt;</span><span class="crayon-o">/</span><span class="crayon-i">body</span><span class="crayon-o">&gt;</span></div><div class="crayon-line crayon-striped-line" id="crayon-528e2a7feb752161715216-56"><span class="crayon-o">&lt;</span><span class="crayon-o">/</span><span class="crayon-i">html</span><span class="crayon-o">&gt;</span></div></div></td>
            </tr>
        </table>
    </div>
</div><p>至此，文章完</p>
</div>
</section>

<footer class="post-foot">
    <p>
            <span class="right post-share">
    分享：
    <i class="icon icon-weibo"></i>
    <i class="icon icon-renren"></i>
    <i class="icon icon-pinterest-sign"></i>
</span>                        <span class="tag">
                <i class="icon icon-archive" title="分类"></i>
                分类：<a href="http://www.yanue.net/archives/category/google-map" title="查看Google Map中的全部文章" rel="category tag">Google Map</a> <a href="http://www.yanue.net/archives/category/original" title="查看原创文章中的全部文章" rel="category tag">原创文章</a>            </span>
                                    <span class="tag">
                <i class="icon icon-tags" title="标签"></i>
                标签：<a href="http://www.yanue.net/archives/tag/%e5%9c%b0%e7%90%86%e8%a7%a3%e6%9e%90" rel="tag">地理解析</a>            </span>
    </p>
    <ul class="post-nav-single">
        <li class="post-nav-previous">
            <a href="http://www.yanue.net/archives/207.html" rel="prev"><i class="icon icon-hand-left"></i> 上一篇： (原创)经纬度查询,经纬度(批量)查找地名,地名(批量)查询经纬度,google map地理解析geocode.geocoder实例</a>            </li>
        <li class="post-nav-next">
            <a href="http://www.yanue.net/archives/311.html" rel="next">下一篇：JQuery获取和设置Select选项方法 <i class="icon icon-hand-right"></i></a>            </li>
    </ul>
</footer>
<div class="clearfix"></div>
</article>            <section class="post-related"><h3 class="related-title">你可能还会对下面的内容感兴趣：</h3><ul class="related-list"><li><a href="http://www.yanue.net/archives/217.html"title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解"><i class="icon icon-star-empty"></i> (原创)谷歌地图地理解析和反解析geocode.geocoder详解</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/174.html"title="(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单"><i class="icon icon-star-empty"></i> (原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/952.html"title="解决Ajax跨域问题：Origin xx is not allowed by Access-Control-Allow-Origin."><i class="icon icon-star-empty"></i> 解决Ajax跨域问题：Origin xx is not allowed by Access-Control-Allow-Origin.</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/945.html"title="sphinx配置文件详解"><i class="icon icon-star-empty"></i> sphinx配置文件详解</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/853.html"title="gps纠偏数据库及gps纠偏算法PHP"><i class="icon icon-star-empty"></i> gps纠偏数据库及gps纠偏算法PHP</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/845.html"title="gps纠偏及大陆地图偏移原因"><i class="icon icon-star-empty"></i> gps纠偏及大陆地图偏移原因</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/776.html"title="ubuntu 13.04下编译安装mysql"><i class="icon icon-star-empty"></i> ubuntu 13.04下编译安装mysql</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/597.html"title="MySQL查看用户权限的两种方法"><i class="icon icon-star-empty"></i> MySQL查看用户权限的两种方法</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/584.html"title="MySQL之替换字符串函数replace()的使用"><i class="icon icon-star-empty"></i> MySQL之替换字符串函数replace()的使用</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/522.html"title="Linux下磁盘管理du命令"><i class="icon icon-star-empty"></i> Linux下磁盘管理du命令</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/503.html"title="命令模式坚决svn树冲突（local unversioned, incoming add upon update）"><i class="icon icon-star-empty"></i> 命令模式坚决svn树冲突（local unversioned, incoming add upon update）</a><span> <strong> </strong></span></li><li><a href="http://www.yanue.net/archives/502.html"title="js颜色阶梯过渡（均匀渐变）Gradient算法"><i class="icon icon-star-empty"></i> js颜色阶梯过渡（均匀渐变）Gradient算法</a><span> <strong> </strong></span></li></ul></section><a name="comments"></a>

<div class="ds-thread" data-thread-key="217" data-author-key="1" data-title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解" data-url="http://www.yanue.net/archives/217.html"></div>

<script type="text/javascript">
    if (typeof DUOSHUO !== 'undefined')
        DUOSHUO.EmbedThread('.ds-thread');
</script>
<div id="ds-ssr">


    <ol id="commentlist">
        <li class="comment even thread-even depth-1" id="li-comment-865">
            <article id="comment-865" class="comment">
                <footer class="comment-meta">
                    <cite class="comment-author vcard">
                        <span class="fn"><a href='http://www.zhaopianqiangla.com/' rel='external nofollow' class='url'>相框制作</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-865"><time pubdate datetime="2013-06-05T04:33:27+00:00">2013/06/05 at 04:33</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                </footer>

                <div class="comment-content"><p>找资料谷歌搜索过来的，谢谢分享</p>
                </div>

            </article><!-- #comment-## -->
        </li><!-- #comment-## -->
        <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-127">
            <article id="comment-127" class="comment">
                <footer class="comment-meta">
                    <cite class="comment-author vcard">
                        <span class="fn">Bill</span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-127"><time pubdate datetime="2013-01-11T06:44:51+00:00">2013/01/11 at 06:44</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                </footer>

                <div class="comment-content"><p>你好，</p>
                    <p>我想给自己的网站加个地图，已经取得API key v3， 但我对你所说的和网上说的解析一点都不懂，怎样才能得到和API key相应的地址啊， 如果方便能不能留个电话我想请教下， 我是业余的所以可能有些ABC的东西我都不懂。谢谢。</p>
                </div>

            </article><!-- #comment-## -->
            <ul class="children">
                <li class="comment byuser comment-author-yanue bypostauthor even depth-2" id="li-comment-128">
                    <article id="comment-128" class="comment">
                        <footer class="comment-meta">
                            <cite class="comment-author vcard">
                                <span class="fn"><a href='http://www.yanue.net/' rel='external nofollow' class='url'>yanue</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-128"><time pubdate datetime="2013-01-11T06:49:58+00:00">2013/01/11 at 06:49</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                        </footer>

                        <div class="comment-content"><p>不知到你放到你都网站是什么目的,需要实现什么功能</p>
                        </div>

                    </article><!-- #comment-## -->
                    <ul class="children">
                        <li class="comment odd alt depth-3" id="li-comment-129">
                            <article id="comment-129" class="comment">
                                <footer class="comment-meta">
                                    <cite class="comment-author vcard">
                                        <span class="fn">Bill</span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-129"><time pubdate datetime="2013-01-11T07:00:16+00:00">2013/01/11 at 07:00</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                                </footer>

                                <div class="comment-content"><p>越简单越好，我想做外贸做个公司的地址标志就好，有个小的标记可以显示公司名称的，然后就是可以有放大缩小的。其它不用，关键是不会什么geocoding, 实在看不懂。</p>
                                </div>

                            </article><!-- #comment-## -->
                            <ul class="children">
                                <li class="comment byuser comment-author-yanue bypostauthor even depth-4" id="li-comment-130">
                                    <article id="comment-130" class="comment">
                                        <footer class="comment-meta">
                                            <cite class="comment-author vcard">
                                                <span class="fn"><a href='http://www.yanue.net/' rel='external nofollow' class='url'>yanue</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-130"><time pubdate datetime="2013-01-11T07:03:34+00:00">2013/01/11 at 07:03</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                                        </footer>

                                        <div class="comment-content"><p>额 那很容易实现的</p>
                                        </div>

                                    </article><!-- #comment-## -->
                                    <ul class="children">
                                        <li class="comment odd alt depth-5" id="li-comment-131">
                                            <article id="comment-131" class="comment">
                                                <footer class="comment-meta">
                                                    <cite class="comment-author vcard">
                                                        <span class="fn">Bill</span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-131"><time pubdate datetime="2013-01-11T07:11:03+00:00">2013/01/11 at 07:11</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                                                </footer>

                                                <div class="comment-content"><p>我看了google教程，代码也复制了，但怎样解析地址就有点不懂，看到好像要写个地址给google去反馈经纬度，但没看出和API key的联系，还有写的这些提交给哪里也不清楚。不知我说的对不？能不能教下我。</p>
                                                </div>

                                            </article><!-- #comment-## -->
                                        </li><!-- #comment-## -->
                                        <li class="comment byuser comment-author-yanue bypostauthor even depth-5" id="li-comment-132">
                                            <article id="comment-132" class="comment">
                                                <footer class="comment-meta">
                                                    <cite class="comment-author vcard">
                                                        <span class="fn"><a href='http://www.yanue.net/' rel='external nofollow' class='url'>yanue</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-132"><time pubdate datetime="2013-01-11T07:23:12+00:00">2013/01/11 at 07:23</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                                                </footer>

                                                <div class="comment-content"><p>其实使用google maps api时多数都不需要api key的,我一直都没有用到,我也不知道射门地方需要用到.好像是每天的api请求是受次数限制的,因此,如果有大量的api调用次数,就需要用到key.对否?<br />
                                                        还有地理位置(地址)反解析出经维度,实现非常简单,我的那个例子里面就包含里解析和反解析的.主要就是用到google地理解析服务geocoder.geocode类</p>
                                                </div>

                                            </article><!-- #comment-## -->
                                        </li><!-- #comment-## -->
                                    </ul><!-- .children -->
                                </li><!-- #comment-## -->
                            </ul><!-- .children -->
                        </li><!-- #comment-## -->
                    </ul><!-- .children -->
                </li><!-- #comment-## -->
            </ul><!-- .children -->
        </li><!-- #comment-## -->
        <li class="comment odd alt thread-even depth-1" id="li-comment-125">
            <article id="comment-125" class="comment">
                <footer class="comment-meta">
                    <cite class="comment-author vcard">
                        <span class="fn">gdtv</span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-125"><time pubdate datetime="2012-12-27T00:42:39+00:00">2012/12/27 at 00:42</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                </footer>

                <div class="comment-content"><p>受教了，多谢</p>
                </div>

            </article><!-- #comment-## -->
        </li><!-- #comment-## -->
        <li class="comment even thread-odd thread-alt depth-1" id="li-comment-121">
            <article id="comment-121" class="comment">
                <footer class="comment-meta">
                    <cite class="comment-author vcard">
                        <span class="fn"><a href='http://weibo.com/jochlin' rel='external nofollow' class='url'>JocH_Lin</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-121"><time pubdate datetime="2012-10-17T06:42:27+00:00">2012/10/17 at 06:42</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                </footer>

                <div class="comment-content"><p>你好，我看到你的GPS经纬转换成地址的实例了，但是假如我想利用经纬度转换成建筑物的名称，该用什么Google Api呢？我一直找不到一个合适的，但是Google Map上确实又能准确地显示出来。谢谢！</p>
                </div>

            </article><!-- #comment-## -->
            <ul class="children">
                <li class="comment byuser comment-author-yanue bypostauthor odd alt depth-2" id="li-comment-122">
                    <article id="comment-122" class="comment">
                        <footer class="comment-meta">
                            <cite class="comment-author vcard">
                                <span class="fn"><a href='http://www.yanue.net/' rel='external nofollow' class='url'>yanue</a></span> on <a rel="nofollow" href="http://www.yanue.net/archives/217.html#comment-122"><time pubdate datetime="2012-10-29T17:16:00+00:00">2012/10/29 at 17:16</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
                        </footer>

                        <div class="comment-content"><p>并没有具体的api可以将经纬度转换成建筑物，只能转换到地名（地名有可能是建筑物）。不过建筑物可以转换成经纬度</p>
                        </div>

                    </article><!-- #comment-## -->
                </li><!-- #comment-## -->
            </ul><!-- .children -->
        </li><!-- #comment-## -->
    </ol>


</div>            </div>
</section>

<script type="text/javascript">
    var tmpClickTab = 'newest';
    $(document).on('click','.widget-tab .tab',function(){
        var tab_content = $(this).attr('data-tab');
        if(!(tmpClickTab && tmpClickTab==tab_content)){
            $('.widget-tab .tab').removeClass('current');
            $('.tab-post-list').find('ul').hide();
            $(this).addClass('current');
            $('.tab-post-list .'+tab_content).fadeIn();

        }
        tmpClickTab = tab_content;
    });
</script>
<section class="sidebar">
    <form role="search" method="get" class="search-form" action="http://www.yanue.net/">
        <label>
            <i class="icon  icon-search"></i>
            <span class="screen-reader-text">Search :</span>
            <input type="search" class="txt search-field" placeholder="搜索&hellip;" value="" name="s" title="搜索：" />
        </label>
        <input type="submit" class="search-submit button" value="搜索" />
    </form>    <h3 class="widget-tab">
        <span class="tab current" data-tab='newest'>
            最近更新
        </span>
        <span class="tab" data-tab='most-views'>
            最新热门
        </span>
        <span class="tab" data-tab='popular'>
            评论排行
        </span>
    </h3>
    <div class="tab-post-list">
        <ul class="newest">
            <li><i class="count">06-09</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/217.html" title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a> </li><li><i class="count">05-22</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/174.html" title="(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单">(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单</a> </li><li><i class="count">10-25</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/956.html" title="MongoDB增加用户认证: 增加用户、删除用户、修改用户密码、读写权限、只读权限">MongoDB增加用户认证: 增加用户、删除用户、修改用户密码、读写权限、只读权限</a> </li><li><i class="count">10-18</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/952.html" title="解决Ajax跨域问题：Origin xx is not allowed by Access-Control-Allow-Origin.">解决Ajax跨域问题：Origin xx is not allowed by Access-Control-Allow-Origin.</a> </li><li><i class="count">10-16</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/945.html" title="sphinx配置文件详解">sphinx配置文件详解</a> </li><li><i class="count">10-16</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/944.html" title="Sphinx+Scws全文检索引擎方案安装部署">Sphinx+Scws全文检索引擎方案安装部署</a> </li><li><i class="count">10-07</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/936.html" title="CentOS下编译php时的一些典型错误及解决办法">CentOS下编译php时的一些典型错误及解决办法</a> </li><li><i class="count">10-06</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/930.html" title="linux alias 自定义命令">linux alias 自定义命令</a> </li><li><i class="count">09-16</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/918.html" title="ubuntu中解压zip文件时乱码的问题">ubuntu中解压zip文件时乱码的问题</a> </li><li><i class="count">09-11</i> <i class="icon   icon-angle-right"></i> <a href="http://www.yanue.net/archives/893.html" title="解决mysqldump备份报错：SET OPTION SQL_QUOTE_SHOW_CREATE=1">解决mysqldump备份报错：SET OPTION SQL_QUOTE_SHOW_CREATE=1</a> </li>        </ul>
        <ul class="most-views" style="display:none;">
            <li> <i class="count">54849</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/77.html" title="js判断浏览器类型及版本详细分析 （js判断ie6）">js判断浏览器类型及版本详细分析 （js判断ie6）</a> </li><li> <i class="count">14432</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/359.html" title="带头像三级评论回复html+css代码">带头像三级评论回复html+css代码</a> </li><li> <i class="count">10019</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/217.html" title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a> </li><li> <i class="count">9302</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/73.html" title="js判断ie6 ie6完美提示框">js判断ie6 ie6完美提示框</a> </li><li> <i class="count">8566</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/413.html" title="GPS坐标转换经纬度及换算方法">GPS坐标转换经纬度及换算方法</a> </li><li> <i class="count">7997</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/32.html" title="在线查询经纬度 google map查询地名返回经纬度 geocode geocoder的完整实例 代码下载">在线查询经纬度 google map查询地名返回经纬度 geocode geocoder的完整实例 代码下载</a> </li><li> <i class="count">7828</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/398.html" title="seajs打包部署工具spm的使用总结">seajs打包部署工具spm的使用总结</a> </li><li> <i class="count">7521</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/417.html" title="jquery全屏漂浮广告插件，可点击关闭(原创)">jquery全屏漂浮广告插件，可点击关闭(原创)</a> </li><li> <i class="count">6853</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/207.html" title="(原创)经纬度查询,经纬度(批量)查找地名,地名(批量)查询经纬度,google map地理解析geocode.geocoder实例">(原创)经纬度查询,经纬度(批量)查找地名,地名(批量)查询经纬度,google map地理解析geocode.geocoder实例</a> </li><li> <i class="count">6487</i> <i class="icon icon-star-half-empty"></i><a href="http://www.yanue.net/archives/169.html" title="php查询mysql表中所有字段详细信息">php查询mysql表中所有字段详细信息</a> </li>        </ul>
        <ul class="popular" style="display:none;">
            <li><i class="count">10</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/32.html" title="在线查询经纬度 google map查询地名返回经纬度 geocode geocoder的完整实例 代码下载">在线查询经纬度 google map查询地名返回经纬度 geocode geocoder的完整实例 代码下载</a> </li><li><i class="count">10</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/217.html" title="(原创)谷歌地图地理解析和反解析geocode.geocoder详解">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a> </li><li><i class="count">9</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/174.html" title="(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单">(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单</a> </li><li><i class="count">7</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/about" title="关于我">关于我</a> </li><li><i class="count">4</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/362.html" title="jquery判断点击事件是否在目标区域">jquery判断点击事件是否在目标区域</a> </li><li><i class="count">4</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/398.html" title="seajs打包部署工具spm的使用总结">seajs打包部署工具spm的使用总结</a> </li><li><i class="count">3</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/77.html" title="js判断浏览器类型及版本详细分析 （js判断ie6）">js判断浏览器类型及版本详细分析 （js判断ie6）</a> </li><li><i class="count">3</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/417.html" title="jquery全屏漂浮广告插件，可点击关闭(原创)">jquery全屏漂浮广告插件，可点击关闭(原创)</a> </li><li><i class="count">2</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/63.html" title="zend framework配置文件之错误提示设置，数据库设置">zend framework配置文件之错误提示设置，数据库设置</a> </li><li><i class="count">2</i> <i class="icon  icon-comments-alt"></i> <a href="http://www.yanue.net/archives/116.html" title="php保存远程图片到本地 php正则匹配文章中的远程图片地址">php保存远程图片到本地 php正则匹配文章中的远程图片地址</a> </li>        </ul>
    </div>
    <aside id="categories-2" class="widget widget_categories"><h3 class="widget-title">分类目录</h3>		<ul>
            <li class="cat-item cat-item-9"><a href="http://www.yanue.net/archives/category/google-map" title="查看Google Map下的所有文章">Google Map</a> (6)
            </li>
            <li class="cat-item cat-item-54"><a href="http://www.yanue.net/archives/category/linux" title="查看linux下的所有文章">linux</a> (20)
                <ul class='children'>
                    <li class="cat-item cat-item-55"><a href="http://www.yanue.net/archives/category/linux/ubuntu" title="查看ubuntu下的所有文章">ubuntu</a> (11)
                    </li>
                </ul>
            </li>
            <li class="cat-item cat-item-82"><a href="http://www.yanue.net/archives/category/mongo" title="查看mongo下的所有文章">mongo</a> (1)
            </li>
            <li class="cat-item cat-item-28"><a href="http://www.yanue.net/archives/category/p-h-p" title="查看php下的所有文章">php</a> (40)
            </li>
            <li class="cat-item cat-item-25"><a href="http://www.yanue.net/archives/category/sql" title="查看sql下的所有文章">sql</a> (23)
                <ul class='children'>
                    <li class="cat-item cat-item-34"><a href="http://www.yanue.net/archives/category/sql/mysql" title="查看mysql下的所有文章">mysql</a> (14)
                    </li>
                </ul>
            </li>
            <li class="cat-item cat-item-17"><a href="http://www.yanue.net/archives/category/zend-framework" title="查看Zend Framework下的所有文章">Zend Framework</a> (5)
            </li>
            <li class="cat-item cat-item-32"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88" title="查看前端综合下的所有文章">前端综合</a> (30)
                <ul class='children'>
                    <li class="cat-item cat-item-24"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88/css3" title="查看css3下的所有文章">css3</a> (2)
                    </li>
                    <li class="cat-item cat-item-66"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88/html5" title="查看html5下的所有文章">html5</a> (2)
                    </li>
                    <li class="cat-item cat-item-11"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88/javascript" title="查看javascript下的所有文章">javascript</a> (10)
                    </li>
                    <li class="cat-item cat-item-51"><a href="http://www.yanue.net/archives/category/%e5%89%8d%e7%ab%af%e7%bb%bc%e5%90%88/jquery" title="查看jquery下的所有文章">jquery</a> (2)
                    </li>
                </ul>
            </li>
            <li class="cat-item cat-item-6"><a href="http://www.yanue.net/archives/category/original" title="查看原创文章下的所有文章">原创文章</a> (35)
            </li>
            <li class="cat-item cat-item-3"><a href="http://www.yanue.net/archives/category/%e5%9f%9f%e5%90%8d%e4%b8%bb%e6%9c%ba" title="查看域名主机下的所有文章">域名主机</a> (2)
            </li>
            <li class="cat-item cat-item-12"><a href="http://www.yanue.net/archives/category/%e5%bc%80%e5%8f%91%e5%b7%a5%e5%85%b7" title="查看开发工具下的所有文章">开发工具</a> (7)
                <ul class='children'>
                    <li class="cat-item cat-item-59"><a href="http://www.yanue.net/archives/category/%e5%bc%80%e5%8f%91%e5%b7%a5%e5%85%b7/svn" title="查看svn下的所有文章">svn</a> (1)
                    </li>
                    <li class="cat-item cat-item-49"><a href="http://www.yanue.net/archives/category/%e5%bc%80%e5%8f%91%e5%b7%a5%e5%85%b7/vim" title="查看vim下的所有文章">vim</a> (1)
                    </li>
                </ul>
            </li>
            <li class="cat-item cat-item-1"><a href="http://www.yanue.net/archives/category/%e6%9d%82%e9%a1%b9" title="杂项">杂项</a> (5)
            </li>
        </ul>
    </aside>		<aside id="recent-posts-2" class="widget widget_recent_entries">		<h3 class="widget-title">近期文章</h3>		<ul>
            <li>
                <a href="http://www.yanue.net/archives/217.html">(原创)谷歌地图地理解析和反解析geocode.geocoder详解</a>
                <span class="post-date">2012/06/09</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/174.html">(原创)php数据库导入导出类，mysql备份恢复分卷处理，调用简单</a>
                <span class="post-date">2012/05/22</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/956.html">MongoDB增加用户认证: 增加用户、删除用户、修改用户密码、读写权限、只读权限</a>
                <span class="post-date">2013/10/25</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/952.html">解决Ajax跨域问题：Origin xx is not allowed by Access-Control-Allow-Origin.</a>
                <span class="post-date">2013/10/18</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/945.html">sphinx配置文件详解</a>
                <span class="post-date">2013/10/16</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/944.html">Sphinx+Scws全文检索引擎方案安装部署</a>
                <span class="post-date">2013/10/16</span>
            </li>
            <li>
                <a href="http://www.yanue.net/archives/936.html">CentOS下编译php时的一些典型错误及解决办法</a>
                <span class="post-date">2013/10/07</span>
            </li>
        </ul>
    </aside><aside id="tag_cloud-2" class="widget widget_tag_cloud"><h3 class="widget-title">标签</h3><div class="tagcloud"><a href='http://www.yanue.net/archives/tag/htaccess' class='tag-link-4' title='2个话题' style='font-size: 11.111111111111pt;'>.htaccess</a>
            <a href='http://www.yanue.net/archives/tag/confirm' class='tag-link-46' title='1个话题' style='font-size: 8pt;'>confirm</a>
            <a href='http://www.yanue.net/archives/tag/css' class='tag-link-52' title='2个话题' style='font-size: 11.111111111111pt;'>css</a>
            <a href='http://www.yanue.net/archives/tag/flash' class='tag-link-31' title='1个话题' style='font-size: 8pt;'>flash</a>
            <a href='http://www.yanue.net/archives/tag/forward' class='tag-link-20' title='1个话题' style='font-size: 8pt;'>forward</a>
            <a href='http://www.yanue.net/archives/tag/geocoder' class='tag-link-10' title='2个话题' style='font-size: 11.111111111111pt;'>geocoder</a>
            <a href='http://www.yanue.net/archives/tag/goagent' class='tag-link-41' title='1个话题' style='font-size: 8pt;'>GoAgent</a>
            <a href='http://www.yanue.net/archives/tag/google-map' class='tag-link-9' title='1个话题' style='font-size: 8pt;'>Google Map</a>
            <a href='http://www.yanue.net/archives/tag/gps' class='tag-link-48' title='1个话题' style='font-size: 8pt;'>gps</a>
            <a href='http://www.yanue.net/archives/tag/gps%e7%ba%a0%e5%81%8f' class='tag-link-76' title='2个话题' style='font-size: 11.111111111111pt;'>gps纠偏</a>
            <a href='http://www.yanue.net/archives/tag/grant' class='tag-link-63' title='2个话题' style='font-size: 11.111111111111pt;'>grant</a>
            <a href='http://www.yanue.net/archives/tag/gvim' class='tag-link-53' title='2个话题' style='font-size: 11.111111111111pt;'>gvim</a>
            <a href='http://www.yanue.net/archives/tag/html5' class='tag-link-66' title='2个话题' style='font-size: 11.111111111111pt;'>html5</a>
            <a href='http://www.yanue.net/archives/tag/ie6' class='tag-link-22' title='1个话题' style='font-size: 8pt;'>ie6</a>
            <a href='http://www.yanue.net/archives/tag/ip' class='tag-link-65' title='2个话题' style='font-size: 11.111111111111pt;'>ip</a>
            <a href='http://www.yanue.net/archives/tag/javascript' class='tag-link-11' title='1个话题' style='font-size: 8pt;'>javascript</a>
            <a href='http://www.yanue.net/archives/tag/jquery' class='tag-link-51' title='3个话题' style='font-size: 13.185185185185pt;'>jquery</a>
            <a href='http://www.yanue.net/archives/tag/jquery-pop' class='tag-link-7' title='1个话题' style='font-size: 8pt;'>jquery.pop</a>
            <a href='http://www.yanue.net/archives/tag/json' class='tag-link-15' title='2个话题' style='font-size: 11.111111111111pt;'>json</a>
            <a href='http://www.yanue.net/archives/tag/js%e6%95%b0%e7%bb%84' class='tag-link-16' title='1个话题' style='font-size: 8pt;'>js数组</a>
            <a href='http://www.yanue.net/archives/tag/js%e6%ad%a3%e5%88%99' class='tag-link-27' title='2个话题' style='font-size: 11.111111111111pt;'>js正则</a>
            <a href='http://www.yanue.net/archives/tag/layout' class='tag-link-30' title='1个话题' style='font-size: 8pt;'>layout</a>
            <a href='http://www.yanue.net/archives/tag/linux' class='tag-link-54' title='6个话题' style='font-size: 17.506172839506pt;'>linux</a>
            <a href='http://www.yanue.net/archives/tag/mssql' class='tag-link-26' title='1个话题' style='font-size: 8pt;'>mssql</a>
            <a href='http://www.yanue.net/archives/tag/mvc%e6%a1%86%e6%9e%b6' class='tag-link-57' title='1个话题' style='font-size: 8pt;'>MVC框架</a>
            <a href='http://www.yanue.net/archives/tag/mysql' class='tag-link-34' title='12个话题' style='font-size: 22pt;'>mysql</a>
            <a href='http://www.yanue.net/archives/tag/p-h-p' class='tag-link-28' title='6个话题' style='font-size: 17.506172839506pt;'>php</a>
            <a href='http://www.yanue.net/archives/tag/phpdoc' class='tag-link-61' title='2个话题' style='font-size: 11.111111111111pt;'>phpdoc</a>
            <a href='http://www.yanue.net/archives/tag/powerdesigner' class='tag-link-75' title='2个话题' style='font-size: 11.111111111111pt;'>powerdesigner</a>
            <a href='http://www.yanue.net/archives/tag/redirect' class='tag-link-21' title='2个话题' style='font-size: 11.111111111111pt;'>redirect</a>
            <a href='http://www.yanue.net/archives/tag/render' class='tag-link-19' title='1个话题' style='font-size: 8pt;'>render</a>
            <a href='http://www.yanue.net/archives/tag/seajs' class='tag-link-44' title='1个话题' style='font-size: 8pt;'>seajs</a>
            <a href='http://www.yanue.net/archives/tag/sphinx' class='tag-link-80' title='2个话题' style='font-size: 11.111111111111pt;'>sphinx</a>
            <a href='http://www.yanue.net/archives/tag/vim' class='tag-link-49' title='4个话题' style='font-size: 14.913580246914pt;'>vim</a>
            <a href='http://www.yanue.net/archives/tag/zend-framework-2' class='tag-link-18' title='2个话题' style='font-size: 11.111111111111pt;'>zend framework</a>
            <a href='http://www.yanue.net/archives/tag/%e4%bd%8d%e8%bf%90%e7%ae%97' class='tag-link-56' title='1个话题' style='font-size: 8pt;'>位运算</a>
            <a href='http://www.yanue.net/archives/tag/%e5%88%86%e5%8d%b7' class='tag-link-33' title='2个话题' style='font-size: 11.111111111111pt;'>分卷</a>
            <a href='http://www.yanue.net/archives/tag/%e5%88%86%e9%a1%b5' class='tag-link-39' title='1个话题' style='font-size: 8pt;'>分页</a>
            <a href='http://www.yanue.net/archives/tag/%e5%9c%b0%e7%90%86%e8%a7%a3%e6%9e%90' class='tag-link-36' title='2个话题' style='font-size: 11.111111111111pt;'>地理解析</a>
            <a href='http://www.yanue.net/archives/tag/%e5%9f%9f%e5%90%8d' class='tag-link-5' title='1个话题' style='font-size: 8pt;'>域名</a>
            <a href='http://www.yanue.net/archives/tag/%e6%96%87%e4%bb%b6%e5%a4%84%e7%90%86' class='tag-link-50' title='1个话题' style='font-size: 8pt;'>文件处理</a>
            <a href='http://www.yanue.net/archives/tag/%e6%97%b6%e9%97%b4%e6%88%b3' class='tag-link-40' title='3个话题' style='font-size: 13.185185185185pt;'>时间戳</a>
            <a href='http://www.yanue.net/archives/tag/%e6%ad%a3%e5%88%99' class='tag-link-29' title='7个话题' style='font-size: 18.37037037037pt;'>正则</a>
            <a href='http://www.yanue.net/archives/tag/%e8%ae%b0%e4%ba%8b%e7%8b%97' class='tag-link-23' title='1个话题' style='font-size: 8pt;'>记事狗</a>
            <a href='http://www.yanue.net/archives/tag/%e8%b7%af%e7%94%b1' class='tag-link-35' title='1个话题' style='font-size: 8pt;'>路由</a></div>
    </aside><aside id="pages-2" class="widget widget_pages"><h3 class="widget-title">页面</h3>		<ul>
            <li class="page_item page-item-209"><a href="http://www.yanue.net/about">关于我</a></li>
            <li class="page_item page-item-414"><a href="http://www.yanue.net/original">原创作品</a></li>
            <li class="page_item page-item-284"><a href="http://www.yanue.net/links">友情链接</a></li>
            <li class="page_item page-item-746"><a href="http://www.yanue.net/archives">日志归档</a></li>
            <li class="page_item page-item-743"><a href="http://www.yanue.net/tags">标签云</a></li>
            <li class="page_item page-item-749"><a href="http://www.yanue.net/readers">读者墙</a></li>
        </ul>
    </aside>        <a class="tag-link tag-link-36" href="http://www.yanue.net/archives/tag/%e5%9c%b0%e7%90%86%e8%a7%a3%e6%9e%90">地理解析</a>

</section>        <div class="clearfix"></div>
</div>
</div>
<link rel='stylesheet' id='crayon-css'  href='http://www.yanue.net/wp-content/plugins/crayon-syntax-highlighter/css/min/crayon.min.css?ver=2.4.1' type='text/css' media='all' />
<script type='text/javascript' src='http://www.yanue.net/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
<script type='text/javascript' src='http://www.yanue.net/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<script type='text/javascript'>
    /* <![CDATA[ */
    var CrayonSyntaxSettings = {"version":"2.4.1","is_admin":"0","ajaxurl":"http:\/\/www.yanue.net\/wp-admin\/admin-ajax.php","prefix":"crayon-","setting":"crayon-setting","selected":"crayon-setting-selected","changed":"crayon-setting-changed","special":"crayon-setting-special","orig_value":"data-orig-value","debug":""};
    var CrayonSyntaxStrings = {"copy":"\u4f7f\u7528 %s \u590d\u5236\uff0c\u4f7f\u7528 %s \u7c98\u8d34\u3002","minimize":"Click To Expand Code"};
    /* ]]> */
</script>
<script type='text/javascript' src='http://www.yanue.net/wp-content/plugins/crayon-syntax-highlighter/js/min/crayon.min.js?ver=2.4.1'></script>
<footer class="footer">
    <cite class="right" style="padding:0 8px;color:#888;text-shadow:0 0 0 rgba(255,255,255,0);">yanue.net - The Private Theme <a href="http://yanue.net">wp-senth</a></cite>
    <span style="padding:0 8px;"> 2013 &copy; <a href="http://yanue.net" title="半叶寒羽">半叶寒羽</a></span>
</footer>
</body>
</html>